<template>
	<button @click="aaa++">{{ aaa }}--{{ bbb }}</button>
	<p>{{ data.a }}</p>
	
	<hr>
	
	<hr>
	<Aaa ref="refAaa" :aaa="aaa" @aaa_emit_change="aaa_emit_change"></Aaa>
</template>

<script setup lang="ts">
	import { toRefs, ref, reactive, getCurrentInstance } from 'vue'
	import Aaa from './aaa.vue'
	let { proxy: _this } = getCurrentInstance() as any;
	let aaa = ref(22222222222)
	let bbb = aaa
	let data = toRefs(reactive({
		a: 1
	}))
	
	// setTimeout(function() {
	// 	// data.a++
	// 	console.log( _this.a );
	// 	console.log( 'data.a', _this.data.a.value, data.a.value );
	// }, 1000);
	
	function aaa_emit_change(e: any){
		
		console.log('子组件传递的数据', e);
		_this.aaa = e
	}
	
	let refAaa = ref<any>(null)
	setTimeout(() => {
		console.log(refAaa.value.a, 11123)
		console.log(refAaa.value.b, 222)
	}, 1500);
</script>

<style>
</style>
